{include file="$header" /}
<section class="mk-cms-warp">
    <aside class="aside">
        <section class="aside-wrap">
            <div class="side-title">{{lang('Categories')}}</div>
            <el-tree :data="treeData">
                <span class="custom-tree-node" slot-scope="{ node, data }">
                    <a :href="data.url">{{data.title}}</a>
                </span>
            </el-tree>
        </section>
        <section class="aside-wrap">
            <div class="side-title">{:lang('Featured Products')}</div>
            <div class="side-product">  
                <mk-swiper
                    direction="vertical"
                    :between="0"
                    :pagination="false"
                    :list="productList">
                    <template v-slot:item="{ item }">
                        <a :href="item.url">
                            <img :src="item.cover"/>
                            <span>{{item.title}}</span>
                        </a>
                    </template>
                </mk-swiper>
            </div>
        </section>
    </aside>
    <div class="main">
        <div class="main-title">{$catalog.title}</div>
        {empty name="list"}
        <el-empty description="{:lang('No data')}"></el-empty>
        {else/}
        <div class="main-list">
            <ul>
                {volist name="list" id="vo"}
                <li class="product-item">
                    <figure class="item-wrap">
                        <a href="{$vo.url}" title="{$vo.title}" class="item-img">
                            <img src="{$vo.cover}" alt="{$vo.title}">
                        </a> 
                        <figcaption class="item-info">
                            <h3 class="item-title">
                                <a href="{$vo.url}" title="{$vo.title}">{$vo.title}</a>
                            </h3>
                        </figcaption>
                    </figure>
                </li>
                {/volist}
            </ul>
        </div>
        {$page|raw}
        {/empty}
    </div>
</section>
{include file="$component" /}
<script type="text/javascript">
    new Vue({
        el: '#app',
        data() {
            return {
                treeData: {:json_encode(get_catalog_child($catalog.class1))},
                productList: {:json_encode(get_product_list(["isrecommend"]))},
            }
        },
    });
</script>
{include file="$footer" /}